const {request,server} = require("../../utils/request");

Page({
  data: {
    imageURL:'https://img01.yzcdn.cn/vant/ipad.jpeg',
    arr:[],
    server
  },
  async onChange(e){
    // console.log(e);
    let params = {
      num:e.detail,
      id:e.target.dataset.index
    }
    // console.log(params);
    // return;
    const r = await request({
      url: '/api/car',
      data:params,
      method:'post'
    })
  },
  async onShow(){
    const r = await request({
      url: '/api/car'
    })
    // console.log(r);
    this.setData({
      arr:r.list
    })
  }
})